package org.Dominio;

import java.util.ArrayList;
import java.util.LinkedList;
import org.Persistencia.*;

public class GestorPersonas {

	private AgenteDB Agente;
	private LinkedList<LinkedList<Object>> persona; 


	public LinkedList<LinkedList<Object>> get_persona() {
		return persona;
	}

	public String read(PersonaD p) {
		String s = "";
		try {
			persona = Agente.getAgente().select(
					"SELECT id FROM personad WHERE user='" + p.get_usuario()
							+ "' AND password='" + p.get_password() + "';");
		} catch (Exception e) {
		}
		if (!persona.isEmpty()) {
			s = persona.poll().poll().toString();
		}
		return s;

	}
}
